<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui"
        xmlns:ut="http://java.sun.com/jsf/composite/components/tags">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
    <f:view contentType="text/html">

        <h:head>
            <title>Профиль пользователя</title>
        </h:head>
        <h:body>
            <h:form>
                <h:commandLink value="Список доступных лотов" action="lots.xhtml?faces-redirect=true" />
                <h:outputLabel value="#{mainPage.message}"/>
                <br/>
                <h:outputLabel value="Вы вошли в систему, как пользователь #{mainPage.userName}"/>
                <br/>
                <p:dataTable styleClass="aristo" id="things" value="#{profileBean.usersThings}" var="thing" selectionMode="single" selection="#{thingBean.thing}">

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Тип предмета" />
                        </f:facet>
                        <h:outputText value="#{thing.thingType.name}" />
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Подробная характеристика" />
                        </f:facet>
                        <h:outputText value="#{thing.additionalOption}" />
                    </p:column>

                    <f:facet name="footer" >
                        <h:commandButton value="Подробная информация" action="#{profileBean.goToThingInfo}" />
                    </f:facet>

                </p:dataTable>
                <p:commandButton value="Сгенерировать вещь" action="#{profileBean.createNewThing}" global="false" update="things" />
            </h:form>
        </h:body>
    </f:view>
</html>

</ui:composition>

